﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using MvcApplication1.Models;

namespace MvcApplication1.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Save(ProductModel inputProduct)
        {
            //string message = string.Format("Created product '{0}' in the system.", inputProduct.Name);            
            string message = "Name:"+inputProduct.Name + ": ID:"+ inputProduct.Id + ": PRICE:" + inputProduct.Price+":";            
            return Json(new ProductViewModel { Message = message });
        }
    }
}
